All Functions of Week 8

which

{base}

return indexes of TRUE entries of a logical vector

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

setwd

{base}

Set Working Directory

stargazer

{stargazer}

Create a regression output table

lm

{base}

Fit a linear model

class

{base}

Retrieve class of an R object

ggplot

{GGPLOT2}

Create a ggplot graph

data.frame

{base}

Create a data.frame from vectors

confint

{stats}

Calculate confidence Intervals for Model Parameters

xlab

{GGPLOT2}

Label the x axis (ggplot)

rbind

{base}

Combine R objects by rows

ylab

{GGPLOT2}

Label the y axis (ggplot)

sum

{base}

Get sum of numeric values or a vector

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

geom_vline

{GGPLOT2}

Draws a vertical line

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

element_text

{GGPLOT2}

Customise text in GGPLOT2

rm

{base}

Remove objects

head

{utils}

Show first 5 rows of a data frame

str

{utils}

Get the structure of an R object

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

geom_hline

{GGPLOT2}

Add a horizontal line in GGPLOT2

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

mutate

{dplyr}

Modify/create a column in a data frame

cor

{stats}

Calculate Correlation Matrix

dim

{base}

Get dimensions of a data frame

filter

{dplyr}

Filter out rows of a data frame according to logical vector

scale_colour_manual

{GGPLOT2}

Create your own discrete scale

mean

{base}

Get mean of a vector

ifelse

{base}

Return a or b depending on the value of test

names

{base}

Retrieve names of a list/vector

attach

{base}

Attach Set of R Objects to Search Path

reorder

{stats}

Reorder Levels of Factor based on the values of a second variable, usually numeric.

theme

{GGPLOT2}

Set theme for GGPLOT2

coord_flip

{GGPLOT2}

Flip the x and y axes of a graph

c

{base}

Combine values/vectors into a vector

with

{base}

evaluate expression in the context of a data frame

quantile

{stats}

Obtain empirical quantiles of a vector

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

order

{base}

Get indexes that will sort a vector

colnames

{base}

Retrieve column names of a data frame

geom_histogram

{GGPLOT2}

Generates a histogram

labs

{GGPLOT2}

Customise labels in GGPLOT2

summary

{base}

Obtain summary statistics or detailed regression output

library

{base}

Load an R package

as.factor

{base}

Coerce a vector to factor

print

{base}

Print object to the console

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

select

{dplyr}

Select columns from a tibble/data frame

geom_point

{GGPLOT2}

Generates a scatter plot

predict

{stats}

Predict Probability

The end!